  const delayTime = 1.5 // 控制滚动的速度，1ms往左移动1px
        let myTimer = null
        function scrollDiv(ele) {
            let container = document.getElementById(ele) // 获取元素
            container.innerHTML = container.innerHTML + container.innerHTML + container.innerHTML + container.innerHTML
            // 多复制几份为了防止出现尾部空白和断层，可以根据div中总元素宽度调整复制几份
            let childDivList = container.children
            // 监听每个子元素的鼠标移入、移出
            for (let childDiv of childDivList) {
                childDiv.onmouseover = function () {
                    clearTimeout(myTimer) //移入终止执行moveDiv函数
                }
                childDiv.onmouseout = function () {
                    moveDiv(ele) //移出则重新执行moveDiv函数
                }
            }
            moveDiv(ele)
        }
        function moveDiv(ele) {
            let container = document.getElementById(ele)
            container.scrollLeft++
            if (container.scrollLeft >= container.scrollWidth / 4) {
                container.scrollLeft = 0 //当元素移动从第一个红色div到第一个黑色div时，恢复初始位置，进行轮循
            }
            myTimer = setTimeout("moveDiv('" + ele + "')", delayTime) // delayTime = 1ms之后，重新执行moveDiv函数
        }
        window.onload = function () {
            scrollDiv("carousel-container");
        }